﻿@inject NetCoreCMS.IServices.IOrdersService _orders
@model List<Orders>
@{
    Layout = null;
    Sysconfig config = ViewData["config"] as Sysconfig;
}
<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>我的订单</title>
    <link rel="stylesheet" type="text/css" href="/mobile/css/style.css" />
    <script type="text/javascript" charset="utf-8" src="/mobile/js/zepto.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/weui.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/common.js"></script>
</head>

<body ontouchstart>
    <div class="page">
        <!--页面头部-->
        <div class="header">
            <a class="back" href="javascript:history.back();">
                <i class="iconfont icon-arrow-left"></i>
            </a>
            <h3>我的订单</h3>
            <div class="right">
                <a class="weui-cell_access weui-cell_link" asp-controller="Usercenter" asp-action="Index" asp-route-act="index">
                    <i class="iconfont icon-user"></i>
                </a>
            </div>
        </div>
        <!--/页面头部-->

        <div class="page__bd">
            <!--订单列表-->
            <div class="detail-list">
                <ul>
                    <!--取得分页页码列表-->
                    @foreach (Orders dr in Model)
                    {
                        <li>
                            <div class="detail-hd">
                                <span class="fr">@_orders.get_order_status(dr.id)</span>
                                <span>@dr.order_no</span>
                            </div>
                            <div class="detail-bd">
                                @{var ls = _orders.get_order_goods_list(dr.id);}
                                @if (ls != null)
                                {
                                    @foreach (Article modelt in ls)
                                    {
                                        <div class="list-box">
                                            <div class="img-box">
                                                <img src="@modelt.img_url" />
                                            </div>
                                            <div class="txt-box">
                                                <h2>@modelt.title</h2>
                                                <p class="note">
                                                    <span class="fr"></span>
                                                    <span class="price">￥@modelt.sell_price</span>
                                                </p>
                                            </div>
                                        </div>
                                    }
                                }
                            </div>
                            <div class="detail-ft">
                                <p class="fr">订单总金额：￥@dr.order_amount 元</p>
                                <p>@dr.add_time</p>
                                <div class="ft-btn">
                                    <div class="btn-box">
                                        <a asp-action="Show" asp-route-id="@dr.id">查看订单</a>
                                        @if (dr.express_status != 2)
                                        {
                                            <a href="/Web/UserOrder/Edit/@dr.id">修改地址</a>
                                        }
                                        @if (_orders.get_order_payment_status(dr.id))
                                        {
                                            <a href="/Web/Payment/Index?action=confirm&order_no=@dr.order_no">去付款</a>
                                        }
                                        @if (dr.status < 2)
                                        {
                                            <a href="javascript:;" onclick="clickSubmit('/order_ajax?action=order_cancel&order_no=@dr.order_no');">取消订单</a>
                                        }
                                    </div>
                                </div>
                            </div>
                        </li>
                    }
                    @if (Model.Count == 0)
                    {
                        <div class="nodata">暂无记录...</div>
                    }
                </ul>
            </div>

            <!--分页页码-->
            <div class="page-list">
                @Html.Raw(ViewBag.pagelist)
            </div>
            <!--/分页页码-->

            <input id="turl" type="hidden" value="/Web/Userorder/Index" /><!--存在跳转的URL值-->
            <!--/订单列表-->
        </div>

        <!--版权信息-->
        @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Copyright.cshtml")
        <!--/版权信息-->
        <!--底部导航-->
        @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Footer.cshtml")
        <!--/底部导航-->
    </div>
</body>
</html>
